package com.miracle.main.module.di.module;

import com.miracle.basemvp.di.scope.ActivityScope;
import com.miracle.common.adapter.SingleSelectAdapter;
import com.miracle.common.bean.User.CheckBean;
import com.miracle.common.util.CommonConstants;
import com.miracle.main.R;
import com.miracle.main.module.mvp.contract.AddSecretContract;
import com.miracle.main.module.mvp.model.AddSecretModel;

import java.util.ArrayList;
import java.util.List;

import dagger.Module;
import dagger.Provides;


/**
 * com.miracle.main.module.di.module
 * (c)2018 AIR Times Inc. All rights reserved.
 *
 *
 * @author WangJQ
 * @version 1.0
 * @date 2018/7/7 11:26
 * @see com.miracle.main.module.di.module
 */
@ActivityScope
@Module
public class AddSecretModule {
    private AddSecretContract.View mView;

    public AddSecretModule(AddSecretContract.View view) {
        mView = view;
    }

    @ActivityScope
    @Provides
    AddSecretContract.View provideView() {
        return mView;
    }

    @ActivityScope
    @Provides
    AddSecretContract.Model provideModel(AddSecretModel model) {
        return model;
    }

    @ActivityScope
    @Provides
    List<CheckBean> provideCheckBean() {
        List<CheckBean> mList = new ArrayList<>();

        for (int i = 0; i < CommonConstants.Mood.IDS.length; i++) {
            CheckBean bean = new CheckBean();
            bean.setText(CommonConstants.Mood.VALUES[i]);
            bean.setId(CommonConstants.Mood.IDS[i]);
            bean.setChecked(false);
            mList.add(bean);
        }
        return mList;
    }

    @ActivityScope
    @Provides
    SingleSelectAdapter provideSingleAdapter(List<CheckBean> list) {
        return new SingleSelectAdapter(R.layout.item_common_single_check, list);
    }
}
